
package com.my.xadmin.security.service;

import com.my.framework.exception.ServiceException;
import com.my.framework.page.Page;
import com.my.xadmin.security.entity.User;

import java.util.List;
import java.util.Map;

public interface UserService {
	
	User getByUsername(String username);
	
	List<User> find(Page page, String name);

	void update(User user);
	
	void updatePwd(User user, String newPwd) throws ServiceException;

	void save(User user) throws ServiceException;

	User get(Long id);

	void delete(Long id) throws ServiceException;

	List<User> findAll(Page page);
	
	/**
	 * 判断是否超级管理员.
	 */
	boolean isSupervisor(Long id);
	
	List<User> findAll();

    User findByAuthKey(String authKey);
    
    /**
	 * Find by filter jpa.
	 * 
	 * @param page
	 *            the page
	 * @param searchParams
	 *            the search params
	 * @return the list
	 */
	List<User> findByFilterJpa(Page page, Map<String, Object> searchParams);

	
}
